home *** CD-ROM | disk | FTP | other *** search
/ Ray Dream Studio 5 / Ray Dream.iso / pc / DreamSDK / Macintosh / Samples / link / LINK / COMLINK.h < prev    next >
Encoding:
Text File  |  1997-07-09  |  2.1 KB  |  71 lines

  1. // Copyright (c)1995 Ray Dream, Inc. All Rights Reserved.
  2. /*$Id: COMLINK.h 1.3 1996/08/08 21:19:39 Damien Exp $*/
  3.  
  4. //
  5. // COM Example of Motion Link
  6. //
  7.  
  8. #ifndef __COMLINK__
  9. #define __COMLINK__  
  10.  
  11. #ifndef __I3DEXLNK__
  12. #include "I3DExLnk.h"
  13. #endif
  14.                   
  15. // define the ScrewLink CLSID
  16. // {D87962A0-F1ED-11ce-A4F7-0000E202D5A5}
  17. DEFINE_GUID(CLSID_ScrewLink,0xd87962a0,0xf1ed,0x11ce,0xa4,0xf7,0x0,0x0,0xe2,0x2,0xd5,0xa5);
  18.  
  19.  
  20. #define ID(a,b,c,d) ((((long)(a))<<24)+(((long)(b))<<16)+(((long)(c))<<8)+(((long)(d))))
  21. #define kAxisX (long)1
  22. #define kAxisY (long)2
  23. #define kAxisZ (long)3
  24.  
  25.  
  26. typedef struct ScrewLinkData {
  27.   long     fAxis;  // ID of the axis (AXEX AXEY or AXEZ)
  28.   NUM3D    fStep;  // Step of the screw (1 turn -> translation of fStep)
  29.   NUM3D    fFreedomValue; 
  30.   } ScrewLinkData;
  31.  
  32.  
  33. // ScrewLink Object :
  34. #undef INTERFACE
  35. #define INTERFACE ScrewLink
  36. class ScrewLink : public I3DExMotionLink {
  37. public :  
  38.   ScrewLink();
  39.   ~ScrewLink();
  40.   
  41.   // IUnknown Interface :
  42.   STDMETHODIMP         QueryInterface(THIS_ REFIID riid, LPVOID* ppvObj);
  43.   STDMETHODIMP_(ULONG) AddRef(THIS);
  44.   STDMETHODIMP_(ULONG) Release(THIS);
  45.   
  46.   // I3DExtension method :
  47.   STDMETHODIMP_(I3DExtension*) Clone(THIS);
  48.   STDMETHODIMP                 ShellUtilitiesInit(THIS_ IShUtilities* shellUtilities);  
  49.   
  50.   // I3DExDataExchanger methods :
  51.   STDMETHODIMP_(ExtensionDataMap*) GetExtensionDataMap(THIS);
  52.   STDMETHODIMP_(void*)             GetExtensionDataBuffer(THIS);
  53.   STDMETHODIMP                     ExtensionDataChanged(THIS);
  54.   STDMETHODIMP                     HandleEvent(THIS_ ULONG sourceID);
  55.   STDMETHODIMP_(short)             GetResID(THIS);
  56.   
  57.   // I3DExMotionLink methods
  58.     STDMETHODIMP_(short)  GetNbrFreedom(THIS);
  59.   STDMETHODIMP          IncrementFreedomValue(THIS_ short index, NUM3D* increment);    
  60.   STDMETHODIMP          GetFreedomRange(THIS_ short index, NUM3D* min, NUM3D* max);
  61.     STDMETHODIMP          GetTransform(THIS_ TRANSFORM3D* transform);
  62.     STDMETHODIMP          GetTransformPartialDerivate(THIS_ short index, TRANSFORM3D* transform);
  63.  
  64. private :
  65.   ULONG         fCRef;         // reference Counter
  66.   ScrewLinkData fData;         // Screw Link Data
  67.   };
  68.  
  69.  
  70. #endif
  71.